negotiator.repository
Class AgentRepItem

java.lang.Object
  extended by negotiator.repository.AgentRepItem
All Implemented Interfaces:
java.io.Serializable, RepItem

public class AgentRepItem
extends java.lang.Object
implements RepItem

This repository item contains all info about an agent that can be loaded.

Author:
wouter
See Also:
Serialized Form

Constructor Summary
AgentRepItem()
          Parameters of the agent, for example a concession parameter
AgentRepItem(java.lang.String aName, java.lang.String cPath, java.lang.String desc)
           
AgentRepItem(java.lang.String aName, java.lang.String cPath, java.lang.String desc, java.lang.String param)
           
 
Method Summary
 java.lang.Object callStaticAgentFunction(java.lang.String methodname, java.lang.Object[] params)
          callAgentFunction can call a Static agent function without instantiating the agent.
 boolean equals(java.lang.Object o)
           
 java.lang.String getClassPath()
           
 java.lang.String getDescription()
           
 java.lang.String getName()
           
 java.lang.String getParams()
           
 java.lang.String getVersion()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentRepItem

public AgentRepItem()
Parameters of the agent, for example a concession parameter


AgentRepItem

public AgentRepItem(java.lang.String aName,
                    java.lang.String cPath,
                    java.lang.String desc)

AgentRepItem

public AgentRepItem(java.lang.String aName,
                    java.lang.String cPath,
                    java.lang.String desc,
                    java.lang.String param)
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
Returns:
true if agentName and classPath equal. Note that agentName alone is sufficient to be equal as keys are unique.

getName

public java.lang.String getName()
Specified by:
getName in interface RepItem

getClassPath

public java.lang.String getClassPath()

getVersion

public java.lang.String getVersion()

callStaticAgentFunction

public java.lang.Object callStaticAgentFunction(java.lang.String methodname,
                                                java.lang.Object[] params)
                                         throws java.lang.Exception
callAgentFunction can call a Static agent function without instantiating the agent. This is used to get the version and parameters from the agent class in general.

Parameters:
methodname - contains the name of the method, eg "getVersion"
params - contains an array of parameters to the call, eg Object[0] for no parameters.
Returns:
the object returned by that function
Throws:
any - exception that the function can throw, or failures by not finding the class, failure to load the description, etc.
java.lang.Exception

getParams

public java.lang.String getParams()

getDescription

public java.lang.String getDescription()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object